<template>
  <div class="employee">
    <div class="sideNav">
      <AsideNav :isCollapse="isCollapse"></AsideNav>
    </div>
    <div class="employee-content" :class="{'el-menu--collapse': isCollapsed}">
      <div class="emp-header-nav">
        <EmpHeader @isCollapse="handleParameter"></EmpHeader>
      </div>
      <el-container>
        <el-main class="emplpyee-main" style="overflow:auto">
          <el-breadcrumb separator=">">
            <el-breadcrumb-item :to="{ path: '/admin/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item v-text="this.$route.name"></el-breadcrumb-item>
          </el-breadcrumb>
          <router-view></router-view>
        </el-main>
      </el-container>
    </div>
  </div>
</template>

<script>
import { getRoomList, getAllRoom, updateRoomStatus } from '@/api/room'
import AsideNav from '@/components/employee/AsideNav.vue'
import EmpHeader from '@/components/employee/EmpHeader.vue'
export default {
  name: 'employeeIndex',
  components: {
    AsideNav,
    EmpHeader
  },
  data () {
    return {
      isCollapse: false
    }
  },
  methods: {
    handleParameter (parameter) {
      this.isCollapse = parameter
      console.error("123"+this.isCollapse)
    }
  }

}
</script>

<style lang="less" scoped>
.employee {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.sideNav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  overflow: hidden;
}

.employee-content {
  width: 100%;
  margin-left: 200px;

  .emp-header-nav {
    width: 100%;
  }

  .emplpyee-main {
    width: 100%;
    height: calc(100vh - 50px);
    overflow-y: auto;
  }
}
.el-menu--collapse {
  width: 100%;
  margin-left: 128px;
}

</style>
